<?php 
$message = '';
$db = new mysqli('localhost', 'root', 'root', 'rashidStone');
if($db->connect_error) {
    $message = $db->connect_error;
} 
$name = $_POST['name'];
$default = $_POST['default'];
$type = $_POST['TagType'];
$link = $_POST['LinkToBlock'];
$permission = $_POST['TagPermission'];
$standard = $name;

  $standard = preg_replace('/[\'"$#@!%^&*(){}<>?.,|_]/', '', $standard); // Eliminate all quotes
  $standard = preg_replace('/[^a-zA-Z0-9]+/', '', $standard); // Remove all spaces
  $standard = strtolower($standard); // Lowercase everything
   



$sql="INSERT INTO Tag (Name, Standard, isDefault, TagType, TagPermission, LinkToBlock)
VALUES ('$name', '$standard', '$default', '$type', '$permission', '$link')";

if (!mysqli_query($db,$sql))
{
  die('Error: ' . mysqli_error($db));
}

echo "added successfully";